package com.sgb.kjwl.model.entity.enterprise;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;
import com.sgb.kjwl.utils.NumberUtil;

import java.io.Serializable;

public class IpPickSelectEntity<T> implements Serializable, IPickerViewData {
    @SerializedName(value = "value", alternate = {"no","code", "classificationType"})
    private String value;
    @SerializedName(value = "name", alternate = {"payWay", "simpleName", "type", "text", "val", "area_name", "areaName", "label", "classificationName"})
    private String name;
    @SerializedName(value = "minPrice", alternate = "min_price")
    private String minPrice;
    @SerializedName(value = "maxPrice", alternate = "max_price")
    private String maxPrice;
    @SerializedName("minLength")
    private String minLength;
    @SerializedName("maxLength")
    private String maxLength;
    @SerializedName("id")
    private String id;
    @SerializedName("publishType")
    private String publishType;
    @SerializedName("publishTypeName")
    private String publishTypeName;
    @SerializedName("relateOld")
    private String relateOld;
    @SerializedName(value = "children", alternate = {"cityList"})
    T children;

    public IpPickSelectEntity(String value, String name, String minPrice, String maxPrice, String minLength, String maxLength, String id) {
        this.value = value;
        this.name = name;
        this.minPrice = minPrice;
        this.maxPrice = maxPrice;
        this.minLength = minLength;
        this.maxLength = maxLength;
        this.id = id;
    }

    public IpPickSelectEntity( String id,String name) {
        this.name = name;
        this.id = id;
    }
    public IpPickSelectEntity() {

    }

    public String getPublishTypeName() {
        return publishTypeName;
    }

    public void setPublishTypeName(String publishTypeName) {
        this.publishTypeName = publishTypeName;
    }

    public String getRelateOld() {
        return relateOld;
    }

    public void setRelateOld(String relateOld) {
        this.relateOld = relateOld;
    }

    public String getPublishType() {
        return publishType;
    }

    public void setPublishType(String publishType) {
        this.publishType = publishType;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        if (name == null)
            return "";
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMinPrice() {
        if (minPrice == null)
            return "";
        return NumberUtil.trim0(minPrice);
    }

    public void setMinPrice(String minPrice) {
        this.minPrice = minPrice;
    }

    public String getMaxPrice() {
        if (maxPrice == null)
            return "";
        return NumberUtil.trim0(maxPrice);
    }

    public void setMaxPrice(String maxPrice) {
        this.maxPrice = maxPrice;
    }

    public String getMinLength() {
        if (minLength == null)
            return "";
        return minLength;
    }

    public void setMinLength(String minLength) {
        this.minLength = minLength;
    }

    public String getMaxLength() {
        if (maxLength == null)
            return "";
        return maxLength;
    }

    public void setMaxLength(String maxLength) {
        this.maxLength = maxLength;
    }

    public T getChildren() {
        return children;
    }

    public void setChildren(T children) {
        this.children = children;
    }

    @Override
    public String getPickerViewText() {
        return name;
    }
}
